<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <div id="timer" style="color:red"></div>
</body>

</html>
<!--<script>
    var today = new Date()
    var d1 = new Date("October 13, 1975 11:13:00")
    var d2 = new Date(79, 5, 24)
    var d3 = new Date(2017, 2, 23, 23, 59, 59)
    console.log(d1);
    console.log(d2);
    console.log(d3);

    function countDown(isD) {

    }
</script>-->

<script>
    var maxtime = 60 * 60 + 30 * 60

    function CountDown() {
        if (maxtime >= 0) {
            minutes = Math.floor(maxtime / 60);
            seconds = Math.floor(maxtime % 60);
            minutes = minutes >= 10 ? minutes : '0' + minutes;
            seconds = seconds >= 10 ? seconds : '0' + seconds;
            msg = minutes + "分" + seconds + "秒";
            document.all["timer"].innerHTML = msg;
            if (maxtime !== 0)
                --maxtime;
        } else {
            clearInterval(timer);
            alert("时间到，结束!");
        }
    }
    timer = setInterval("CountDown()", 1000);
</script>